﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Pasteles.Controler
{
    class ValidateObject
    {
        //------------------------------------------------------------------------------------Validate-----------------------------------------------------------------------------------//

        public bool nonNumberEntered = false;//bien flag dung de khoa ban phim nhap lieu
        public void validateNum(KeyEventArgs e)//Ham chi cho phep nhap so nguyen duong
        {
            nonNumberEntered = false;
            if (e.KeyCode < Keys.D0 || e.KeyCode > Keys.D9)
            {
                if (e.KeyCode < Keys.NumPad0 || e.KeyCode > Keys.NumPad9)
                {
                    if (e.KeyCode != Keys.Back)
                    {

                        nonNumberEntered = true;
                    }
                }
            }
            if (Control.ModifierKeys == Keys.Shift)
            {
                nonNumberEntered = true;
            }
        }
    }
}
